package com.xt.LibaryDeskManager.utils;

import java.util.HashMap;
import java.util.Map;

//字符串工具类 判定字符串是否为空
public class StrUtils {
	public static boolean empty(String msg){
		return msg!=null && msg.length()>0;
	}
	public static boolean empty(String...msg){
		boolean res = true;
		for(String s:msg){
			res = (s!=null && s.length()>0);
			if(!res){
				break;
			}
		}
		return res;
	}

	public static Map<String,Object> creatMessage(String s1, Object s2){
		Map<String,Object> map=new HashMap<>();
		map.put(s1,s2);
		return map;
	}

	public static Map<String,Object> creatMap(Object o1,Object o2){
		Map<String,Object> result=new HashMap<>();
		result.put("code",0);
		result.put("msg","");
		result.put("data",o1);
		result.put("count",o2);
		return result;
	}
}
